faApp.controller('StatisticalOrderCtrl', ['$scope','StatisticalService','exportService','$location','$controller','$routeParams','$filter',
function($scope,StatisticalService,exportService,$location,$controller,$routeParams,$filter) {
  $controller('BaseListCtrl', {$scope: $scope});

  $scope.list = [];
  $scope.$watch('config',function(){
    if ($scope.watchIsChange()){
      StatisticalService.orderList($scope.config).then(function(json){
        $scope.list = json.list;

        $scope.pager = json.pager;
        $scope.loading = false;
      });
    } 
  },true);

  $scope.orderListCsv = function(){
    exportService.exportCSV($scope.config,"STATISTICAL_ORDER_LIST_CSV");
  }
}
]);

faApp.controller('StatisticalUserCtrl', ['$scope','StatisticalService','exportService','$location','$controller','$routeParams','$filter',
function($scope,StatisticalService,exportService,$location,$controller,$routeParams,$filter) {
  $controller('BaseListCtrl', {$scope: $scope});

  $scope.list = [];

  $scope.$watch('config',function(){
    if ($scope.watchIsChange()){
      StatisticalService.userList($scope.config).then(function(json){
        $scope.list = json.list;
        $scope.pager = json.pager;
        $scope.loading = false;
      });
    } 
  },true);

  $scope.userListCsv = function(){
    exportService.exportCSV($scope.config,"STATISTICAL_USER_LIST_CSV");
  }
}
]);
